package com.pisolution.actuator.service.model;

import lombok.Data;

import java.util.List;

/**
 * @author likai
 * @version 1.0.0
 * @ClassName ActionResult.java
 * @Description TODO
 * @createTime 2021年09月01日 13:46:00
 */
@Data
public class ActionResult<T> {

    private Integer code;

    private String msg;

    private List<T> datas;

    private T data;

    public static ActionResult error(Integer errorCode, String msg){
        ActionResult result = new ActionResult();
        result.setMsg(msg);
        result.setCode(errorCode);
        return result;
    }

    public static ActionResult error(String msg){
        ActionResult result = new ActionResult();
        result.setMsg(msg);
        result.setCode(-1);
        return result;
    }
}
